package com.itheima.service.impl;

import com.itheima.dao.UserMapper;
import com.itheima.domain.User;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    /**
     * 增加
     */
    @Override
    public int insert(User user) {
        return userMapper.insert(user);
    }

    /**
     * 修改
     */
    @Override
    public int update(User user) {
        return userMapper.update(user);
    }

    /**
     * 删除
     */
    @Override
    public int delete(Integer id) {
        return userMapper.delete(id);
    }

    /**
     * 查询
     */
    @Override
    public User info(Integer id) {
        return userMapper.info(id);
    }
}
